<form action="{:url()}" method="post" class="form_single">
    <div class="box">
      <div class="box-body">
        <div class="row">
          <div class="col-md-6">
            <div class="form-group">
              <label>产品名称</label>
              <span>（产品的名称）</span>
              <input class="form-control" name="name" placeholder="请输入产品名称" value="{$info['name']|default=''}" type="text">
            </div>
          </div>
          <div class="col-md-6">
            <div class="form-group">
              <label>产品分类</label>
              <span>（产品所属分类）</span>
              <select class="form-control" name="category">
                <option value="">请选择分类</option>
                {volist name="categories" id="category"}
                <option value="{$key}" {if condition="($info.category ?? '') == $key"}selected{/if}>{$category}</option>
                {/volist}
              </select>
            </div>
          </div>
 
          <!-- <div class="col-md-6">
            <div class="form-group">
              <label>规格</label>
              <span>（产品规格，如20支装、500ml等）</span>
              <input class="form-control" name="specification" placeholder="请输入规格" value="{$info['specification']|default=''}" type="text">
            </div>
          </div> -->

          <div class="col-md-6">
            <div class="form-group">
              <label>批发价</label>
              <span>（产品批发价格）</span>
              <input class="form-control" name="wholesale_price" placeholder="请输入批发价" value="{$info['wholesale_price']|default=''}" type="number" step="0.01">
            </div>
          </div>

          <div class="col-md-6">
            <div class="form-group">
              <label>指导价</label>
              <span>（产品指导价格）</span>
              <input class="form-control" name="guide_price" placeholder="请输入指导价" value="{$info['guide_price']|default=''}" type="number" step="0.01">
            </div>
          </div>

          <div class="col-md-6">
            <div class="form-group">
              <label>行情价</label>
              <span>（当前市场价格）</span>
              <input class="form-control" name="market_price" placeholder="请输入行情价" value="{$info['market_price']|default=''}" type="number" step="0.01">
            </div>
          </div>

          <!-- <div class="col-md-6">
            <div class="form-group">
              <label>品牌</label>
              <span>（产品品牌）</span>
              <input class="form-control" name="brand" placeholder="请输入品牌" value="{$info['brand']|default=''}" type="text">
            </div>
          </div> -->

          <div class="col-md-6">
            <div class="form-group">
              <label>状态</label>
              <span>（产品上架状态）</span>
              <select class="form-control" name="product_status">
                <option value="1" {if condition="($info.product_status ?? 1) == 1"}selected{/if}>上架</option>
                <option value="0" {if condition="($info.product_status ?? 1) == 0"}selected{/if}>下架</option>
              </select>
            </div>
          </div>

          <!-- <div class="col-md-6">
            <div class="form-group">
              <label>VIP专享</label>
              <span>（是否为VIP专享商品）</span>
              <select class="form-control" name="is_vip_only">
                <option value="0" {if condition="($info.is_vip_only ?? 0) == 0"}selected{/if}>否</option>
                <option value="1" {if condition="($info.is_vip_only ?? 0) == 1"}selected{/if}>是</option>
              </select>
            </div>
          </div> -->

          <div class="col-md-6">
            <div class="form-group">
                <label>主图</label>
                <span>（产品主图，用于列表显示）</span>
                <br/>
                {assign name="cover_id" value="$info.cover_id|default='0'" /}
                {:widget('file/index', ['name' => 'cover_id', 'value' => $cover_id, 'type' => 'img'])}
            </div>
          </div>

          <div class="col-md-6">
            <div class="form-group">
                <label>产品多图</label>
                <span>（产品多图，用于详情页轮播展示）</span>
                <br/>
                {assign name="img_ids" value="$info.img_ids|default=''" /}
                {:widget('file/index', ['name' => 'img_ids', 'value' => $img_ids, 'type' => 'imgs'])}
            </div>
          </div>
            
        </div>
      </div>
      <div class="box-footer">
        
        <input type="hidden" name="id" value="{$info['id']|default='0'}"/>
          
        {include file="layout/edit_btn_group"/}
        
      </div>
    </div>
</form>

<script>
$(function() {
     // 设置下拉菜单默认值
     ob.setValue("product_status", {$info.product_status ?? 1});
     ob.setValue("is_vip_only", {$info.is_vip_only ?? 0});
 });
</script>